import { dataTableProps, PaginationProps } from 'naive-ui'
import { PropType } from 'vue'
import { ProTableColumns, ProTableRequest } from './type'

export const proTableProps = {
  ...dataTableProps,
  columns: {
    type: Array as PropType<ProTableColumns>,
    default: () => []
  },
  request: Function as PropType<ProTableRequest>,
  defaultPageIndex: {
    type: Number,
    default: 1
  },
  defaultPageSize: {
    type: Number,
    default: 10
  },
  total: {
    type: Number,
    default: 0
  },
  exportFilename: String,
  columnsAlign: {
    type: String as PropType<'left' | 'center' | 'right'>,
    default: 'center'
  },

  // 覆盖原始table的props
  singleLine: {
    type: Boolean,
    default: false
  },
  striped: {
    type: Boolean,
    default: true
  },
  size: {
    type: String as PropType<'small' | 'medium' | 'large'>,
    default: 'small'
  },
  pagination: {
    type: [Object, Boolean] as PropType<false | PaginationProps>,
    default: true
  }
}
